package com.example.demo.dao;


import com.example.demo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * 用户Dao接口
 */
public interface UserDao extends JpaRepository<User,Integer>, JpaSpecificationExecutor<User> {
    /**
     * 根据用户名查找用户实体
     */
    @Query(value="select*from user where user_name=?1",nativeQuery = true)
    public User findByUserName(String userName);

}
